function Board(boardId, amountOfCards) {
	this.cardAmount = amountOfCards;
	this.id = boardId;
	this.draw = drawBoard;
	if(amountOfCards == 0) {
		this.heigth = rows*250;	
	} else {
		var rows = Math.ceil(amountOfCards/4);
		this.heigth = rows*250;
	}
	
	this.draw = drawBoard;
	this.refreshSize = refreshBoardSize;
	this.addCard = addCardToBoard;
}

function drawBoard(containerSelector) {
	$('<div class="board" id="'+this.id+'" style="height:'+this.heigth+';"><div class="board-center"></div></div>').appendTo(containerSelector);
}

function refreshBoardSize() {
	$('#'+this.id).attr('style','height: '+this.heigth+'px;');
}

function addCardToBoard() {
	this.cardAmount++;
	var rows = Math.ceil(this.cardAmount/4);
	this.heigth = rows*250;
	this.refreshSize();
}



function Card(value, board) {
	this.cardValue = value;
	this.boardId = board;
	this.draw = drawCard;
	
}
	
function drawCard() {
	$('<div class="card" ><div class="card-left-corner"><span class="card-text-little">' + this.cardValue + 
	 '</span></div><div class="card-center"><span class="card-text">' + this.cardValue + 
	 '</span></div><div class="card-rigth-corner"><span class="card-text-little">' + this.cardValue + 
          '<span></div>').appendTo('#'+this.boardId+' > div[class=board-center]');
}



